package nowcoder.day_48.day2;

import java.util.Scanner;

public class Num2 {
    public static void main(String[] args) {


        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String []words = s.split(" ");
        int l = 0;
        int r = words.length;
        StringBuilder sb = new StringBuilder();
        for(int i = words.length;i>=0;i--){
            sb.append(words[i]);
            if (i == 0){
                sb.append(words[i]);
                break;
            }
            sb.append(words[i] + " ");

        }
        System.out.println(sb.toString());

//        Scanner scanner = new Scanner(System.in);
//        String str = scanner.nextLine();
//        String []words = str.split(" ");
//        int l = 0;
//        int r = words.length - 1;
//        while (l < r){
//            String s = words[l];
//            words[l] = words[r];
//            words[r] = s;
//            l++;
//            r--;
//        }
//        StringBuilder sb = new StringBuilder();
//        for (int i = 0; i < words.length; i++) {
//            if (i == words.length - 1){
//                sb.append(words[i]);
//                break;
//            }
//            sb.append(words[i] + ' ');
//
//        }
//        System.out.println(sb.toString());
    }
}
